package com.hyt.it.ogt.kq.service.bm.model.param;

import com.hyt.core.ModelSerializable;
import com.hyt.core.validate.Insert;
import com.hyt.core.validate.Update;
import com.hyt.it.ogt.kq.service.bm.model.entity.ProjectSubject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * @program: it-ogt-bm
 * @description: 报名科目信息对象
 * @author: Yang HuanKun
 * @create: 2022-10-19 15:19
 **/
@Data
@Accessors(chain = true)
@ApiModel(value = "ProjectNodeSubjectParam对象", description = "报名科目信息对象")
public class ProjectNodeSubjectParam implements ModelSerializable {

    @NotNull(message = "缺少报名ID", groups = {Insert.class, Update.class})
    @ApiModelProperty("报名ID")
    private String projectId;

    @NotNull(message = "最多报名科目数不能为空", groups = {Insert.class, Update.class})
    @ApiModelProperty(value = "最多报名科目数")
    private Integer maxSubject;

    @NotNull(message = "最少报名科目数不能为空", groups = {Insert.class, Update.class})
    @ApiModelProperty(value = "最少报名科目数")
    private Integer minSubject;

    @Size(min = 1, message = "缺少报名科目", groups = {Insert.class, Update.class})
    @Valid
    @ApiModelProperty("报名科目")
    private List<ProjectSubject> subjectList;
}
